#include "TcpServer.hpp"
#include <memory>

void Usage(std::string proc)
{
    std::cout << "Usage: " << proc << " port" << std::endl;
}

//EnableFile();

int main(int argc, char *argv[])
{
    if(argc != 2)
    {
        Usage(argv[0]);
        exit(USAGE_ERROR);
    }
    uint16_t port = std::stoi(argv[1]);
    std::unique_ptr<TcpServer> tsvr = std::make_unique<TcpServer>(port); // C++14
    tsvr->InitServer();// 初始化服务器
    tsvr->Loop();// 循环处理连接

    return 0;
}